home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / gfx / 3d / Skulpt_src.lha / sKulpt-src / D3denum.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-08  |  3.9 KB  |  109 lines

  1. //-----------------------------------------------------------------------------
  2. // File: D3DEnum.h
  3. //
  4. // Desc: Functions to enumerate DDraw/D3D drivers, devices, and modes.
  5. //
  6. // Copyright (c) 1997-1999 Microsoft Corporation. All rights reserved
  7. //-----------------------------------------------------------------------------
  8. #ifndef D3DENUM_H
  9. #define D3DENUM_H
  10. #include <d3d.h>
  11.  
  12.  
  13. //-----------------------------------------------------------------------------
  14. // Flag and error definitions
  15. //-----------------------------------------------------------------------------
  16. #define D3DENUM_SOFTWAREONLY           0x00000001 // Software-devices only flag
  17.  
  18. #define D3DENUMERR_NODIRECTDRAW        0x81000001 // Could not create DDraw
  19. #define D3DENUMERR_ENUMERATIONFAILED   0x81000002 // Enumeration failed
  20. #define D3DENUMERR_SUGGESTREFRAST      0x81000003 // Suggest using the RefRast
  21. #define D3DENUMERR_NOCOMPATIBLEDEVICES 0x81000004 // No devices were found that
  22.                                                   // meet the app's desired
  23.                                                   // capabilities
  24.  
  25.  
  26. //-----------------------------------------------------------------------------
  27. // Name: struct D3DEnum_DeviceInfo
  28. // Desc: Structure to hold info about the enumerated Direct3D devices.
  29. //-----------------------------------------------------------------------------
  30. struct D3DEnum_DeviceInfo
  31. {
  32.     // D3D Device info
  33.     TCHAR          strDesc[40];
  34.     GUID*          pDeviceGUID;
  35.     D3DDEVICEDESC7 ddDeviceDesc;
  36.     BOOL           bHardware;
  37.     BOOL           bDesktopCompatible;
  38.  
  39.     // DDraw Driver info
  40.     GUID*          pDriverGUID;
  41.     DDCAPS         ddDriverCaps;
  42.     DDCAPS         ddHELCaps;
  43.  
  44.     // For internal use (apps should not need to use these)
  45.     GUID            guidDevice;
  46.     GUID            guidDriver;
  47. };
  48.  
  49.  
  50. // For code not yet switched to new struct name
  51. typedef D3DEnum_DeviceInfo D3DDEVICEINFO;
  52.  
  53.  
  54.  
  55.  
  56. //-----------------------------------------------------------------------------
  57. // Name: D3DEnum_EnumerateDevices()
  58. // Desc: Enumerates all drivers, devices, and modes. The callback function is
  59. //       called each device, to confirm that the device supports the feature
  60. //       set required by the app.
  61. //-----------------------------------------------------------------------------
  62. HRESULT D3DEnum_EnumerateDevices( HRESULT (*fn)(DDCAPS*, D3DDEVICEDESC7*) );
  63.  
  64.  
  65.  
  66.  
  67. //-----------------------------------------------------------------------------
  68. // Name: D3DEnum_FreeResources()
  69. // Desc: Cleans up any memory allocated during device enumeration
  70. //-----------------------------------------------------------------------------
  71. VOID D3DEnum_FreeResources();
  72.  
  73.  
  74.  
  75.  
  76. //-----------------------------------------------------------------------------
  77. // Name: D3DEnum_GetDevices()
  78. // Desc: Returns a ptr to the array of enumerated D3DDEVICEINFO structures.
  79. //-----------------------------------------------------------------------------
  80. VOID D3DEnum_GetDevices( D3DEnum_DeviceInfo** ppDevices, DWORD* pdwCount );
  81.  
  82.  
  83.  
  84.  
  85. //-----------------------------------------------------------------------------
  86. // Name: D3DEnum_SelectDefaultDevice()
  87. // Desc: Picks a driver based on a set of passed in criteria. The
  88. //       D3DENUM_SOFTWAREONLY flag can be used to pick a software device.
  89. //-----------------------------------------------------------------------------
  90. HRESULT D3DEnum_SelectDefaultDevice( D3DEnum_DeviceInfo** pDevice,
  91.                                      DWORD dwFlags = 0L );
  92.  
  93.  
  94.  
  95.  
  96. //-----------------------------------------------------------------------------
  97. // Name: D3DEnum_UserChangeDevice()
  98. // Desc: Pops up a dialog which allows the user to select a new device.
  99. //-----------------------------------------------------------------------------
  100. HRESULT D3DEnum_UserChangeDevice( D3DEnum_DeviceInfo** ppDevice );
  101.  
  102.  
  103.  
  104.  
  105. #endif // D3DENUM_H
  106.  
  107.  
  108.  
  109.